{extend name="public:public" /}
{block name="section"}
<link href="__ADMIN__/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<div class="page-container" style="margin-left: 200px">
    <form action="" method="post" class="form form-horizontal" id="form-article-edi" enctype="multipart/form-data">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>AppID：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$info.app_id}" placeholder="公众号APPID"  name="app_id">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>AppSecret：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$info.secret}" placeholder="公众号APPSECRET"  name="secret">
            </div>
        </div>
        <div class="row cl ">
            <label class="form-label col-xs-4 col-sm-2 "><span class="c-red"></span>IP白名单：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$Request.ip}" disabled>
                <p style="color: red">开发时记得在微信配置服务器IP白名单</p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>服务器地址：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{:getHostDomain()}/wxserver" disabled>
                <p style="color: red">微信开发配置的服务器地址(URL)</p>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <input onClick="article_save();" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</div>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__ADMIN__/lib/jquery.validation/1.14.0/jquery.validate.js"></script><script type="text/javascript" src="__ADMIN__/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/webuploader/0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">

    function article_save(){
        if(!$('input[name="app_id"]').val() || !$('input[name="secret"]').val()){
            layer.msg('appid和appsecret必须存在',{icon:6,time:2000});
            return false;
        }
        $('#form-article-edi').ajaxSubmit({
            type:'post',
            success:function(data){
                layer.msg(data.msg,{icon:1,time:2000},function(){
                    var index = parent.layer.getFrameIndex(window.name);
                    window.parent.location.reload();
                    parent.layer.close(index);
                })
            }
        });
    }

</script>
{/block}
